<template>
	<view class="goods" @click="toDetail(item)">
		<view class="pic">
			<image class="pic-inner" :src="item.image||''" mode="aspectFill"></image>
		</view>
		<view class="right">
			<view class="store-name v-ellip-2">{{item.store_name}}</view>
			<view class="store-item">
				<view class="item-sub" v-if="item.from_addr_arr[1]">{{item.from_addr_arr[1]}}</view>
			</view>
			<view class="store-item price">
				<view>￥{{item.price}}</view>
				<view style="margin-left: 10rpx;" v-if="item.wear_txt"> | {{item.wear_txt}}</view> 
				<view style="margin-left: 10rpx;" v-if="item.made_at"> | {{item.made_at}}</view> 
			</view>
			<view class="store-item">
				<view class="item-sub desc" v-if="item.cate_names">{{item.cate_names}}</view>
				<view class="item-sub desc" v-if="item.mType">{{item.mType.title}}</view>
			</view>
			<view class="store-item">
				<view class="item-sub desc" v-if="item.model">型号: {{item.model}}</view>
				<view class="item-sub desc" v-if="item.piece_no">件号: {{item.piece_no}}</view>
				<view class="item-sub desc" v-if="item.spec">规格: {{item.spec}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			item: {
				type: Object
			}
		},
		methods:{
			toDetail(item){
				// var userinfo = JSON.stringify(item)
				let id = item.product_id || item.id
				// console.log("item=====",item)
				// this.$tool.navto(`/pages/goods_details/index?id=${id}&userinfo=${userinfo}`);
				this.$tool.navto(`/pages/goods_details/index?id=${this.item.id}`)
			}
		}
	}

</script>

<style lang="scss" scoped>
	.goods{
		background-color: #fff;
		display: flex;
		width: 100%;
		min-height: 240rpx;
		margin-bottom: 10rpx;
		padding: 10rpx;
		border-bottom: 1px solid #ddd;
		.pic{
			display: flex;
			flex-shrink: 0;
			width: 30%;
			// align-items: center;
			.pic-inner{
				width: 100%;
				border-radius: 10rpx;
				max-height: 200rpx;
			}
		}
		.right{
			display: flex;
			flex-direction: column;
			justify-content: space-around;
			width: 70%;
			padding-left: 30rpx;
			.store-name{
				width: 100%;
				font-size: 26rpx;
				
			}
			.store-item{
				display: flex;
				flex-wrap: wrap;
				font-size: 26rpx;
				&.price{
					color: $uni-color-error;
				}
				.item-sub{
					border: 1px solid $uni-color-primary;
					border-radius: 10rpx;
					padding: 1rpx 10rpx;
					margin-top: 5rpx;
					margin-right: 10rpx;
					color: #fff;
					background-color: $uni-color-primary;
					flex-shrink: 0;
					&.desc{
						border: 1px solid #999;
						background-color: #fff;
						color: #333;
					}
				}
			}
		}
	}
</style>